<template>
	<view class="Information_details">
		<view class="Information_details_box" v-if="res">
			<h2 class="Information_details_box_h2">{{res.detail.article_title}}</h2>
			<p class="Information_details_box_name">
				作者&nbsp;:
				<span style="padding: 0 20rpx;">{{res.detail.article_mp}}</span>
			</p>
			<view class="Information_details_box_content" v-html='res.detail.article_content'>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		api_index_get_article_detail
	} from '@/api/Information.js';
	export default {
		data() {
			return {
				res: ''
			};
		},
		onLoad(e) {
			this.api_index_get_article_detailFun(e.id);
		},
		methods: {
			async api_index_get_article_detailFun(id) {
				let data = await api_index_get_article_detail(id);
				this.res = data;
				let content = data.detail.article_content + '';
				content = content.replace(/data-lazy/g, "src");
				content = content.replace(/img/g, 'img style="width:100%;display:block;"');
				this.res.detail.article_content = content;
				console.log(this.res.detail.article_content);
			},
		}
	}
</script>

<style lang="scss">
	.Information_details {
		width: 100%;
		// height: 100vh;
		padding: 40rpx;

		.Information_details_box {
			width: 100%;

			.Information_details_box_h2 {}

			.Information_details_box_name {
				color: #c0c0c0;
				font-size: 26rpx;
				padding: 10rpx 0;
			}
		}
	}
</style>